
#ifndef _Map_H
#define _Map_H



#include <iostream>
#include <SFML/Graphics.hpp>

#include "SFMLMappy.h"
#include "Parallax.h"


using namespace std;


enum Map_Entities 
{
     NONE = 0,             //0
     PLAYER_SPAWN,     //1
     JUMP_PAD,         //2
     TELEPORTER,       //3
     GIN_BOTTLE,       //4
     ENEMY_SPAWN,      //5
     SPIKES,            //6
     EXIT,             //7
     CHECKPOINT        //8
};





enum dir 
{
     Left,
     Right,
     Up,
     Down
};



class c_Map : public SFMLMappy
{
      public:
		  c_Map();

//Variabls     
		  //get starting position
		    sf::Vector2f Get_StartPosition() { return start_pos; }

             
           //Get Size of map, in blocks and in pixels  
			 sf::Vector2f Get_BlockSize() { return size; }
		     sf::Vector2f Get_PixelSize() 
			 {  
				 sf::Vector2f pixel_size;
				 pixel_size.x = size.x * tile_dimensions.x;
				 pixel_size.y = size.y * tile_dimensions.y;

				 return pixel_size;
			 }
             
             //Get tile size(in pixels)
			 sf::Vector2i Get_TileSize() { return tile_dimensions; }

             
             //Map list of all the maps available
             vector <string> List;

			 //Maximum amount of maps
		     int Get_MaxMapCount() { return max_count; }
			 //Maximum amount of enemies
			 int Get_MaxEnemy() { return max_enemy; }
             
             
			 


//Map control funcitons
             void Set_Current(int mapNum);
             int  Get_Current();
             bool Setup_List(string cfg_file);
             void Reset();
			 void Change_Layers(const int layer);
			 void Update_Logic();
             void Draw(int layer);
//Loading functions
             void Load();
             void Load(int mapNum);
             void Load_Next();
             void Load_Previous();
             void Destroy();
           //  void effects_manager();

			  

			 //Start position
			 sf::Vector2f start_pos;

			 //gravity obviously
			 float gravity;
			 int savedGravity;
			 	
      protected:
             
		  
			
		 //size of the map (in blocks)
			 sf::Vector2f size;

		 //size of the tiles (in pixels)
			 sf::Vector2i tile_dimensions;



		    //Parallax scrolling Backgrounds
			vector< Parallax > Backgrounds;
			vector< Parallax > Foregrounds;

		 //Current map	
             int current_map; 
		 //how many maps there are
			 int max_count;

		//how many enemies there are
             int max_enemy;

		//info on the maps
             bool Get_Info(string datafile_loc);              
};

extern c_Map Map;


#endif
